package reduce.fz.com.reduce.service;

import android.content.Context;

import java.util.HashMap;

import reduce.fz.com.reduce.R;
import reduce.fz.com.reduce.abstracts.AbResponseListener;
import reduce.fz.com.reduce.adapter.AbstractRecycleHolder;
import reduce.fz.com.reduce.bean.WitnessCardReply;
import reduce.fz.com.reduce.custom.inter.AbstractResponse;
import reduce.fz.com.reduce.util.ApiUtil;
import reduce.fz.com.reduce.util.HttpUtils;

/**
 * Created by qingshengzheng on 15/11/17.
 */
public class WitnessService {
    private Context context;

    public WitnessService(Context context) {
        this.context = context;
    }
    public void witnessCommentAdd(WitnessCardReply reply,AbResponseListener response)
    {
        String url=ApiUtil.getApi(context,R.array.api_witness_comments_add);
        HttpUtils.jsonPost(url,reply,response);
    }





    public void loadWitnessDynamic(long teamid,  int pageno, long pagesize, AbResponseListener response) {
        String url = ApiUtil.getApi(context, R.array.api_witness_dynamic, teamid, pageno, pagesize);
        HttpUtils.get(url, response);
    }

    public void witnessCard(long cardid, int status, AbResponseListener response) {
        String url = ApiUtil.getApi(context, R.array.api_witness_card, cardid);
        HashMap map = new HashMap();
        map.put("status", status+"");
        HttpUtils.post(url, map, response);
    }
    public void witnessReply(Long cardid,String desc,AbResponseListener listener)
    {
        String url=ApiUtil.getApi(context,R.array.api_witness_comments_add,cardid);
        HashMap map=new HashMap();
        map.put("desc",desc);
        HttpUtils.post(url, map, listener);
    }
}
